//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

namespace Microsoft.Research.eResearch.Blackboard.Common
{
    using System;
    using System.Globalization;

    /// <summary>
    /// Contains information about a subscription item.  The publisher sends a 
    /// <see cref="SubscriptionProfile"/> containing a set of <see cref="SubscriptionItem"/>s
    /// to the Blackboard to indicate its interest in being notified of messages of that type.
    /// </summary>
    [Serializable]
    public class SubscriptionItem
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="SubscriptionItem"/> class.
        /// </summary>
        public SubscriptionItem()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="SubscriptionItem"/> class.
        /// </summary>
        /// <param name="name">The name (key).</param>
        public SubscriptionItem(string name)
        {
            this.Name = name;
        } 

        /// <summary>
        /// Gets or sets the name (key) of the subscription item.
        /// </summary>
        public string Name { get; set; } 

        /// <summary>
        /// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
        /// </summary>
        /// <returns>
        /// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
        /// </returns>
        public override string ToString()
        {
            return String.Format(CultureInfo.CurrentUICulture, "Name={0}", this.Name);
        } 
    }
}
